package com.xindz.cn.mvptest.components.user.model;

import android.graphics.Bitmap;
import android.graphics.BitmapFactory;

import com.avos.avoscloud.AVException;
import com.avos.avoscloud.AVFile;
import com.avos.avoscloud.AVGeoPoint;
import com.avos.avoscloud.AVObject;
import com.avos.avoscloud.AVUser;
import com.avos.avoscloud.SignUpCallback;
import com.xindz.cn.mvptest.components.user.data.LZUser;

import java.io.ByteArrayOutputStream;
import java.util.HashMap;

/**
 * @name MvpTest
 * @class name：com.xindz.cn.mvptest.components.user.model
 * @describe describe
 * @anthor XINDZ
 * @time 2017/10/27 16:01
 * @change
 * @chang time
 * @class describe
 */
public class RegisterModel {
    public void register(String usernum, String pwd, final SignUpCallback signUpCallback) {
        LZUser lzUser = new LZUser();
        lzUser.setMan(true);
        lzUser.put("location", new AVGeoPoint(39.9, 116.4));
        lzUser.setUsername(usernum);
        lzUser.setPassword(pwd);
        lzUser.setXinMing("XINDZ");
        lzUser.setState(1);
        AVObject product = new AVObject("Product");
        product.put("title", "title:" + usernum);
        product.put("description", "description" + usernum);
        product.put("price", 100);
//        product.put("owner", AVUser.getCurrentUser());
        product.put("image", new AVFile("productPic.jgp", "http://ww3.sinaimg.cn/large/7a8aed7bgw1eswencfur6j20hq0qodhs.jpg", new HashMap<String, Object>()));
        product.put("xindz", "测试添加");
        lzUser.put("Product",product);

        lzUser.signUpInBackground(signUpCallback);

    }


}
